<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>11-ajax-xml</title>
		<script type="text/javascript" src="myAjax2.js"></script>
		 <script type="text/javascript">
			window.onload = function(ev)
			{
				var oBtn = document.querySelector("button");
				oBtn.onclick = function(ev1)
				{
					
					ajax({
                    type:"get",
                    url:"11-ajax-xml.php",
					success: function (xhr) {
                        // console.log(xhr.responseXML);
                        // console.log(document);
                        var res = xhr.responseXML;
                        console.log(res.querySelector("name").innerHTML);
                        console.log(res.querySelector("age").innerHTML);
                    },
                    error: function (xhr) {
                        console.log(xhr.status);
                    }
                })
					
				};
				
			};
		 </script>
	</head>
	<body>
	<button>发送请求</button>
	</body>
</html>
